﻿@model DefeatEpidemic.Models.Application

<div class="layui-row">
    <span class="layui-breadcrumb">
        <a href="~/home/index">首页</a>
        <a href="~/applications/Index">申请管理</a>
        <a>
            <cite>创建申请</cite>
        </a>
    </span>
    <a class="layui-btn layui-btn-xs" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon layui-icon-refresh-1" style="line-height:25px;font-size: 10px"></i>
    </a>
</div>
<hr />

<div class="layui-row">
    <form asp-action="Create" class="layui-form">
        <div asp-validation-summary="ModelOnly" class="text-danger"></div>
        <div class="layui-form-item">
            <label asp-for="applicant" class="layui-form-label"></label>
            <div class="layui-input-block">
                <input asp-for="applicant" class="layui-input" placeholder="请输入申请人" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label asp-for="from" class="layui-form-label"></label>
            <div class="layui-input-block">
                <input asp-for="from" class="layui-input" placeholder="请输入从哪里来" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label asp-for="to" class="layui-form-label"></label>
            <div class="layui-input-block">
                <input asp-for="to" class="layui-input" placeholder="请输入要到那里去" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label asp-for="connect" class="layui-form-label"></label>
            <div class="layui-input-block">
                <input asp-for="connect" class="layui-input" placeholder="请输入联系方式" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label asp-for="selfTemp" class="layui-form-label"></label>
            <div class="layui-input-block">
                <input asp-for="selfTemp" class="layui-input" placeholder="输入自测体温" />
            </div>
        </div>
        <div class="layui-form-item">
            <label asp-for="carNumber" class="layui-form-label"></label>
            <div class="layui-input-block">
                <input asp-for="carNumber" class="layui-input" placeholder="请输入车牌号(不开车可不填)" />
            </div>
        </div>
        <div class="layui-form-item">
            <label asp-for="outNumber" class="layui-form-label"></label>
            <div class="layui-input-block">
                <input asp-for="outNumber" class="layui-input" placeholder="请输入出行人数" lay-verify="required" value="1" />
            </div>
        </div>
        <div class="layui-form-item" style="padding-left:30px">

            <a class="layui-btn" href="javascript:;" lay-submit lay-filter="save">创建</a>
            <a asp-action="Index" class="layui-btn layui-btn-primary">返回列表</a>
        </div>
    </form>
</div>
<script>
    var form = layui.form;
    form.on('submit(save)', function (data) {
        var params = {
                'url': '@Url.Action("Create")',
                'type': 'post',
                'data': data.field,
                'showMsg': true,
                //'refresh': true,
            }
            sendAjax(params);
    })
    var member_id = getQueryString("member_id");
    $.getJSON("@Url.Action("GetApplicatInfo")", { "member_id": member_id }, function (json) {
        $("#applicant").val(json.data.name);
        $("#from").val(json.data.address);
        $("#connect").val(json.data.mobile);
    })
</script>
